<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>通用表格组件 | HCFrame</title>
    <meta name="generator" content="VuePress 1.8.0">
    <link rel="icon" href="https://cdn.jsdelivr.net/gh/taixingyiji/image_store@main/blog/favicon/favicon.ico">
    <meta name="description" content="通用框架组件">
    <meta name="keywords" content="通用框架组件">
    <meta name="theme-color" content="#11a8cd">
    <link rel="preload" href="/doc/assets/css/0.styles.6639eb73.css" as="style"><link rel="preload" href="/doc/assets/js/app.858848c6.js" as="script"><link rel="preload" href="/doc/assets/js/4.5c4f8040.js" as="script"><link rel="preload" href="/doc/assets/js/5.dcc7613b.js" as="script"><link rel="preload" href="/doc/assets/js/43.89320d84.js" as="script"><link rel="prefetch" href="/doc/assets/js/1.b35eb13e.js"><link rel="prefetch" href="/doc/assets/js/10.0181a873.js"><link rel="prefetch" href="/doc/assets/js/11.87fb85ee.js"><link rel="prefetch" href="/doc/assets/js/12.e4b39829.js"><link rel="prefetch" href="/doc/assets/js/13.84660e8c.js"><link rel="prefetch" href="/doc/assets/js/14.f9ec9f4f.js"><link rel="prefetch" href="/doc/assets/js/15.28b99a0b.js"><link rel="prefetch" href="/doc/assets/js/16.e182a409.js"><link rel="prefetch" href="/doc/assets/js/17.da343879.js"><link rel="prefetch" href="/doc/assets/js/18.97546c29.js"><link rel="prefetch" href="/doc/assets/js/19.08e8ed96.js"><link rel="prefetch" href="/doc/assets/js/2.0ef8c1f6.js"><link rel="prefetch" href="/doc/assets/js/20.a7200b02.js"><link rel="prefetch" href="/doc/assets/js/21.08f5e320.js"><link rel="prefetch" href="/doc/assets/js/22.6601c123.js"><link rel="prefetch" href="/doc/assets/js/23.fa0e6265.js"><link rel="prefetch" href="/doc/assets/js/24.bb7ed72c.js"><link rel="prefetch" href="/doc/assets/js/25.4e8ad024.js"><link rel="prefetch" href="/doc/assets/js/26.aeb46bbe.js"><link rel="prefetch" href="/doc/assets/js/27.402c8fd6.js"><link rel="prefetch" href="/doc/assets/js/28.4c36f694.js"><link rel="prefetch" href="/doc/assets/js/29.87b27c2b.js"><link rel="prefetch" href="/doc/assets/js/30.4c132372.js"><link rel="prefetch" href="/doc/assets/js/31.6dfd7607.js"><link rel="prefetch" href="/doc/assets/js/32.a5e855dc.js"><link rel="prefetch" href="/doc/assets/js/33.d881911e.js"><link rel="prefetch" href="/doc/assets/js/34.1e90d648.js"><link rel="prefetch" href="/doc/assets/js/35.3c52b00c.js"><link rel="prefetch" href="/doc/assets/js/36.b3a85724.js"><link rel="prefetch" href="/doc/assets/js/37.a7a38cf4.js"><link rel="prefetch" href="/doc/assets/js/38.9aa0834f.js"><link rel="prefetch" href="/doc/assets/js/39.b744486c.js"><link rel="prefetch" href="/doc/assets/js/40.81893cf6.js"><link rel="prefetch" href="/doc/assets/js/41.e1178743.js"><link rel="prefetch" href="/doc/assets/js/42.b90e15cb.js"><link rel="prefetch" href="/doc/assets/js/44.ffc83a5a.js"><link rel="prefetch" href="/doc/assets/js/45.ffc5fa67.js"><link rel="prefetch" href="/doc/assets/js/46.8a5cc6b7.js"><link rel="prefetch" href="/doc/assets/js/47.c4cdfcec.js"><link rel="prefetch" href="/doc/assets/js/48.3b6a28f4.js"><link rel="prefetch" href="/doc/assets/js/49.626d2cc2.js"><link rel="prefetch" href="/doc/assets/js/50.9c1808f6.js"><link rel="prefetch" href="/doc/assets/js/51.e47fd47a.js"><link rel="prefetch" href="/doc/assets/js/52.8f12fc24.js"><link rel="prefetch" href="/doc/assets/js/53.cf120d2a.js"><link rel="prefetch" href="/doc/assets/js/54.fe642a6b.js"><link rel="prefetch" href="/doc/assets/js/55.c6681f9f.js"><link rel="prefetch" href="/doc/assets/js/56.b2f0bd9f.js"><link rel="prefetch" href="/doc/assets/js/57.b5719d8a.js"><link rel="prefetch" href="/doc/assets/js/58.8d41490d.js"><link rel="prefetch" href="/doc/assets/js/59.00cad8af.js"><link rel="prefetch" href="/doc/assets/js/6.860ccc84.js"><link rel="prefetch" href="/doc/assets/js/7.eb3887f4.js"><link rel="prefetch" href="/doc/assets/js/8.6321b925.js"><link rel="prefetch" href="/doc/assets/js/9.8775cc26.js">
    <link rel="stylesheet" href="/doc/assets/css/0.styles.6639eb73.css">
  </head>
  <body class="theme-mode-light">
    <div id="app" data-server-rendered="true"><div class="theme-container sidebar-open have-rightmenu"><header class="navbar blur"><div title="目录" class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/doc/" class="home-link router-link-active"><img src="https://cdn.jsdelivr.net/gh/taixingyiji/image_store@main/blog/20210203141030.png" alt="HCFrame" class="logo"></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/doc/" class="nav-link">首页</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="指南" class="dropdown-title"><a href="/doc/guide/" class="link-title">指南</a> <span class="title" style="display:none;">指南</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/doc/pages/a3c9a2/" class="nav-link">介绍</a></li><li class="dropdown-item"><!----> <a href="/doc/pages/introduce/" class="nav-link">快速开始</a></li><li class="dropdown-item"><!----> <a href="/doc/pages/6fe261/" class="nav-link">打包部署</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="前端" class="dropdown-title"><a href="/doc/web/" class="link-title">前端</a> <span class="title" style="display:none;">前端</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/doc/pages/introduce/" class="nav-link">说明</a></li><li class="dropdown-item"><!----> <a href="/doc/pages/b8a7ad/" class="nav-link">配置</a></li><li class="dropdown-item"><!----> <a href="/doc/pages/5c0128/" class="nav-link">代码示例</a></li><li class="dropdown-item"><!----> <a href="/doc/pages/1ab4ce/" aria-current="page" class="nav-link router-link-exact-active router-link-active">组件</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="后台" class="dropdown-title"><a href="/doc/java/" class="link-title">后台</a> <span class="title" style="display:none;">后台</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/doc/pages/b017cf/" class="nav-link">概要</a></li><li class="dropdown-item"><!----> <a href="/doc/pages/ca1baf/" class="nav-link">通用数据平台</a></li></ul></div></div><div class="nav-item"><a href="http://taixingyiji.tk:5677" target="_blank" rel="noopener noreferrer" class="nav-link external">
  旧版本文档
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar" style="display:none;"><!----> <nav class="nav-links"><div class="nav-item"><a href="/doc/" class="nav-link">首页</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="指南" class="dropdown-title"><a href="/doc/guide/" class="link-title">指南</a> <span class="title" style="display:none;">指南</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/doc/pages/a3c9a2/" class="nav-link">介绍</a></li><li class="dropdown-item"><!----> <a href="/doc/pages/introduce/" class="nav-link">快速开始</a></li><li class="dropdown-item"><!----> <a href="/doc/pages/6fe261/" class="nav-link">打包部署</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="前端" class="dropdown-title"><a href="/doc/web/" class="link-title">前端</a> <span class="title" style="display:none;">前端</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/doc/pages/introduce/" class="nav-link">说明</a></li><li class="dropdown-item"><!----> <a href="/doc/pages/b8a7ad/" class="nav-link">配置</a></li><li class="dropdown-item"><!----> <a href="/doc/pages/5c0128/" class="nav-link">代码示例</a></li><li class="dropdown-item"><!----> <a href="/doc/pages/1ab4ce/" aria-current="page" class="nav-link router-link-exact-active router-link-active">组件</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="后台" class="dropdown-title"><a href="/doc/java/" class="link-title">后台</a> <span class="title" style="display:none;">后台</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/doc/pages/b017cf/" class="nav-link">概要</a></li><li class="dropdown-item"><!----> <a href="/doc/pages/ca1baf/" class="nav-link">通用数据平台</a></li></ul></div></div><div class="nav-item"><a href="http://taixingyiji.tk:5677" target="_blank" rel="noopener noreferrer" class="nav-link external">
  旧版本文档
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>说明</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>配置</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>代码示例</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>组件</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/doc/pages/1ab4ce/" aria-current="page" class="active sidebar-link">通用表格组件</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/doc/pages/1ab4ce/#普通表格" class="sidebar-link">普通表格</a></li><li class="sidebar-sub-header"><a href="/doc/pages/1ab4ce/#带复选框的表格" class="sidebar-link">带复选框的表格</a></li><li class="sidebar-sub-header"><a href="/doc/pages/1ab4ce/#带插槽的表格" class="sidebar-link">带插槽的表格</a></li><li class="sidebar-sub-header"><a href="/doc/pages/1ab4ce/#table-attributes" class="sidebar-link">Table Attributes</a></li><li class="sidebar-sub-header"><a href="/doc/pages/1ab4ce/#table-events" class="sidebar-link">Table Events</a></li><li class="sidebar-sub-header"><a href="/doc/pages/1ab4ce/#table-slot" class="sidebar-link">Table Slot</a></li><li class="sidebar-sub-header"><a href="/doc/pages/1ab4ce/#table-header-style" class="sidebar-link">Table Header style</a></li></ul></li><li><a href="/doc/pages/65ed1c/" class="sidebar-link">表单组件</a></li><li><a href="/doc/pages/49aa37/" class="sidebar-link">流程图组件</a></li><li><a href="/doc/pages/514c8f/" class="sidebar-link">流程图组件之编辑</a></li></ul></section></li></ul> </aside> <div><main class="page"><div class="theme-vdoing-wrapper "><div class="articleInfo-wrap" data-v-583ea4e9><div class="articleInfo" data-v-583ea4e9><ul class="breadcrumbs" data-v-583ea4e9><li data-v-583ea4e9><a href="/doc/" title="首页" class="iconfont icon-home router-link-active" data-v-583ea4e9></a></li> <li data-v-583ea4e9><a href="/doc/web" title="前端-目录页" data-v-583ea4e9>前端</a></li> <li data-v-583ea4e9><a href="/doc/web/#组件" title="前端#组件" data-v-583ea4e9>组件</a></li> <!----></ul> <div class="info" data-v-583ea4e9><div title="作者" class="author iconfont icon-touxiang" data-v-583ea4e9><a href="javascript:;" data-v-583ea4e9>haocheng Liu</a></div> <div title="创建时间" class="date iconfont icon-riqi" data-v-583ea4e9><a href="javascript:;" data-v-583ea4e9>2021-02-03</a></div> <!----></div></div></div> <!----> <div class="content-wrapper"><div class="right-menu-wrapper"><div class="right-menu-margin"><div class="right-menu-content"></div></div></div> <h1><img src="">
          通用表格组件
        </h1> <!----> <div class="theme-vdoing-content content__default"><h1 id="通用表格组件"><a href="#通用表格组件" class="header-anchor">#</a> 通用表格组件</h1> <h2 id="普通表格"><a href="#普通表格" class="header-anchor">#</a> 普通表格</h2> <p>普通表格，仅传入数据显示</p> <hr> <!----> <details class="custom-block details"><summary>代码块</summary> <p><em><strong>ts版本</strong></em></p> <div class="language-vue line-numbers-mode"><pre class="language-vue"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>template</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>table-head-co</span>
      <span class="token attr-name">ref</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableCo<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:form-list</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableList<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:table-heads</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableHead<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:width</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>200<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:cellAlign</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>center<span class="token punctuation">&quot;</span></span>
    <span class="token punctuation">/&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>template</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span><span class="token punctuation">&gt;</span></span><span class="token script"><span class="token language-javascript">
<span class="token keyword">import</span> tableHeadCo <span class="token keyword">from</span> <span class="token string">'@/components/CommonCo/tableHeadCo.vue'</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> Component<span class="token punctuation">,</span> Prop<span class="token punctuation">,</span> Vue <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'vue-property-decorator'</span>

@<span class="token function">Component</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
  name<span class="token operator">:</span> <span class="token string">'commonExample'</span><span class="token punctuation">,</span>
  components<span class="token operator">:</span> <span class="token punctuation">{</span>
    tableHeadCo<span class="token punctuation">,</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span>
<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token keyword">class</span> <span class="token class-name">extends</span> Vue <span class="token punctuation">{</span>
    tableHead<span class="token operator">:</span>any<span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">[</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'date'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'日期'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'name'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'姓名'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'address'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'地址'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">]</span>
    tableList<span class="token operator">:</span>any<span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-02'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-04'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-01'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-03'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">]</span>
<span class="token punctuation">}</span>
</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>style</span> <span class="token attr-name">scoped</span><span class="token punctuation">&gt;</span></span><span class="token style"><span class="token language-css">

</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>style</span><span class="token punctuation">&gt;</span></span>

</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br></div></div><p><em><strong>js版本</strong></em></p> <div class="language-vue line-numbers-mode"><pre class="language-vue"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>template</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>table-head-co</span>
      <span class="token attr-name">ref</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableCo<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:form-list</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableList<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:table-heads</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableHead<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:width</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>200<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:cellAlign</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>center<span class="token punctuation">&quot;</span></span>
    <span class="token punctuation">/&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>template</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span><span class="token punctuation">&gt;</span></span><span class="token script"><span class="token language-javascript">
<span class="token keyword">import</span> tableHeadCo <span class="token keyword">from</span> <span class="token string">'@/components/CommonCo/tableHeadCo.vue'</span>

<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
  components<span class="token operator">:</span> <span class="token punctuation">{</span>
    tableHeadCo
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token function">data</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token punctuation">{</span>
      tableHead<span class="token operator">:</span> <span class="token punctuation">[</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'date'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'日期'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'name'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'姓名'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'address'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'地址'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">]</span><span class="token punctuation">,</span>
    tableList<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-02'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-04'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-01'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-03'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">]</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>style</span> <span class="token attr-name">scoped</span><span class="token punctuation">&gt;</span></span><span class="token style"><span class="token language-css">

</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>style</span><span class="token punctuation">&gt;</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br></div></div></details> <h2 id="带复选框的表格"><a href="#带复选框的表格" class="header-anchor">#</a> 带复选框的表格</h2> <p>带复选框的表格，提供复选框回调函数，点击复选框时可打开控制台查看打印内容。</p> <hr> <!----> <details class="custom-block details"><summary>代码块</summary> <p><em><strong>ts版本</strong></em></p> <div class="language-vue line-numbers-mode"><pre class="language-vue"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>template</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>table-head-co</span>
      <span class="token attr-name">ref</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableCo<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:form-list</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableList<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:table-heads</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableHead<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:width</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>200<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:check-box-visible</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>true<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">@handle-selection-change</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>handleSelectionChange<span class="token punctuation">&quot;</span></span>
    <span class="token punctuation">/&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>template</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span><span class="token punctuation">&gt;</span></span><span class="token script"><span class="token language-javascript">
<span class="token keyword">import</span> tableHeadCo <span class="token keyword">from</span> <span class="token string">'@/components/CommonCo/tableHeadCo.vue'</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> Component<span class="token punctuation">,</span> Prop<span class="token punctuation">,</span> Vue <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'vue-property-decorator'</span>

@<span class="token function">Component</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
  name<span class="token operator">:</span> <span class="token string">'commonExample'</span><span class="token punctuation">,</span>
  components<span class="token operator">:</span> <span class="token punctuation">{</span>
    tableHeadCo<span class="token punctuation">,</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span>
<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token keyword">class</span> <span class="token class-name">extends</span> Vue <span class="token punctuation">{</span>
    tableHead<span class="token operator">:</span>any<span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">[</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'date'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'日期'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'name'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'姓名'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'address'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'地址'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">]</span>

    tableList<span class="token operator">:</span>any<span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-02'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-04'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-01'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-03'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">]</span>

    <span class="token comment">// 复选框监听事件</span>
    <span class="token function">handleSelectionChange</span><span class="token punctuation">(</span><span class="token parameter">val</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
      console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>val<span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>style</span> <span class="token attr-name">scoped</span><span class="token punctuation">&gt;</span></span><span class="token style"><span class="token language-css">

</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>style</span><span class="token punctuation">&gt;</span></span>

</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br></div></div><p><em><strong>js版本</strong></em></p> <div class="language-vue line-numbers-mode"><pre class="language-vue"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>template</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>table-head-co</span>
      <span class="token attr-name">ref</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableCo<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:form-list</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableList<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:table-heads</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableHead<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:width</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>200<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:check-box-visible</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>true<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">@handle-selection-change</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>handleSelectionChange<span class="token punctuation">&quot;</span></span>
    <span class="token punctuation">/&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>template</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span><span class="token punctuation">&gt;</span></span><span class="token script"><span class="token language-javascript">
<span class="token keyword">import</span> tableHeadCo <span class="token keyword">from</span> <span class="token string">'@/components/CommonCo/tableHeadCo.vue'</span>

<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
  components<span class="token operator">:</span> <span class="token punctuation">{</span>
    tableHeadCo
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token function">data</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token punctuation">{</span>
      tableHead<span class="token operator">:</span> <span class="token punctuation">[</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'date'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'日期'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'name'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'姓名'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'address'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'地址'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">]</span><span class="token punctuation">,</span>
    tableList<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-02'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-04'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-01'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-03'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">]</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  methods<span class="token operator">:</span><span class="token punctuation">{</span>
    <span class="token comment">// 复选框改变监听事件</span>
    <span class="token function">handleSelectionChange</span><span class="token punctuation">(</span><span class="token parameter">val</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
      console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>val<span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>style</span> <span class="token attr-name">scoped</span><span class="token punctuation">&gt;</span></span><span class="token style"><span class="token language-css">

</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>style</span><span class="token punctuation">&gt;</span></span>

</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br></div></div></details> <h2 id="带插槽的表格"><a href="#带插槽的表格" class="header-anchor">#</a> 带插槽的表格</h2> <p>表格组件提供插槽功能，可以将插槽设置成按钮等其他功能，点击编辑按钮可以查看控制台打印内容。</p> <hr> <!----> <details class="custom-block details"><summary>代码块</summary> <p><em><strong>ts版本</strong></em></p> <div class="language-vue line-numbers-mode"><pre class="language-vue"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>template</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>table-head-co</span>
      <span class="token attr-name">ref</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableCo<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:form-list</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableList<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:table-heads</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableHead<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:width</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>200<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:slot-visible</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>true<span class="token punctuation">&quot;</span></span>
    <span class="token punctuation">&gt;</span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>template</span>
        <span class="token attr-name">v-slot</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>scope<span class="token punctuation">&quot;</span></span>
      <span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>el-button</span>
          <span class="token attr-name">size</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>mini<span class="token punctuation">&quot;</span></span>
          <span class="token attr-name">@click</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>showEdit(scope.item.row)<span class="token punctuation">&quot;</span></span>
        <span class="token punctuation">&gt;</span></span>
          编辑
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>el-button</span><span class="token punctuation">&gt;</span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>template</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>table-head-co</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>template</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span><span class="token punctuation">&gt;</span></span><span class="token script"><span class="token language-javascript">
<span class="token keyword">import</span> tableHeadCo <span class="token keyword">from</span> <span class="token string">'../Co/tableHeadCo'</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> Component<span class="token punctuation">,</span> Prop<span class="token punctuation">,</span> Vue <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'vue-property-decorator'</span>

@<span class="token function">Component</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
  name<span class="token operator">:</span> <span class="token string">'commonExample'</span><span class="token punctuation">,</span>
  components<span class="token operator">:</span> <span class="token punctuation">{</span>
    tableHeadCo<span class="token punctuation">,</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span>
<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token keyword">class</span> <span class="token class-name">extends</span> Vue <span class="token punctuation">{</span>
    tableHead<span class="token operator">:</span>any<span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">[</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'date'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'日期'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span> commonWidth<span class="token operator">:</span> <span class="token number">120</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'name'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'姓名'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span> commonWidth<span class="token operator">:</span> <span class="token number">100</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'address'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'地址'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">]</span>
    tableList<span class="token operator">:</span>any<span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-02'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-04'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-01'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-03'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">]</span>

    <span class="token comment">// 点击事件</span>
    <span class="token function">showEdit</span><span class="token punctuation">(</span><span class="token parameter">val</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
      console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>val<span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>style</span> <span class="token attr-name">scoped</span><span class="token punctuation">&gt;</span></span><span class="token style"><span class="token language-css">

</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>style</span><span class="token punctuation">&gt;</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br></div></div><p><em><strong>js版本</strong></em></p> <div class="language-vue line-numbers-mode"><pre class="language-vue"><code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>template</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>table-head-co</span>
      <span class="token attr-name">ref</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableCo<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:form-list</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableList<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:table-heads</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>tableHead<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:width</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>200<span class="token punctuation">&quot;</span></span>
      <span class="token attr-name">:slot-visible</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>true<span class="token punctuation">&quot;</span></span>
    <span class="token punctuation">&gt;</span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>template</span>
        <span class="token attr-name">v-slot</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>scope<span class="token punctuation">&quot;</span></span>
      <span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>el-button</span>
          <span class="token attr-name">size</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>mini<span class="token punctuation">&quot;</span></span>
          <span class="token attr-name">@click</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">&quot;</span>showEdit(scope.item.row)<span class="token punctuation">&quot;</span></span>
        <span class="token punctuation">&gt;</span></span>
          编辑
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>el-button</span><span class="token punctuation">&gt;</span></span>
      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>template</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>table-head-co</span><span class="token punctuation">&gt;</span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>template</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>script</span><span class="token punctuation">&gt;</span></span><span class="token script"><span class="token language-javascript">
<span class="token keyword">import</span> tableHeadCo <span class="token keyword">from</span> <span class="token string">'@/components/CommonCo/tableHeadCo.vue'</span>

<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
  components<span class="token operator">:</span> <span class="token punctuation">{</span>
    tableHeadCo
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token function">data</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token punctuation">{</span>
      tableHead<span class="token operator">:</span> <span class="token punctuation">[</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'date'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'日期'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span> commonWidth<span class="token operator">:</span> <span class="token number">120</span>  <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'name'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'姓名'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span> commonWidth<span class="token operator">:</span> <span class="token number">100</span>  <span class="token punctuation">}</span><span class="token punctuation">,</span>
      <span class="token punctuation">{</span> fieldName<span class="token operator">:</span> <span class="token string">'address'</span><span class="token punctuation">,</span> nameCn<span class="token operator">:</span> <span class="token string">'地址'</span><span class="token punctuation">,</span> isHead<span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
    <span class="token punctuation">]</span><span class="token punctuation">,</span>
    tableList<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-02'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-04'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-01'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
            date<span class="token operator">:</span> <span class="token string">'2016-05-03'</span><span class="token punctuation">,</span>
            name<span class="token operator">:</span> <span class="token string">'小明'</span><span class="token punctuation">,</span>
            address<span class="token operator">:</span> <span class="token string">'北京市海淀区中关村南四街'</span>
          <span class="token punctuation">}</span><span class="token punctuation">]</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  methods<span class="token operator">:</span><span class="token punctuation">{</span>
    <span class="token function">showEdit</span><span class="token punctuation">(</span><span class="token parameter">val</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
      console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>val<span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>script</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>style</span> <span class="token attr-name">scoped</span><span class="token punctuation">&gt;</span></span><span class="token style"><span class="token language-css">

</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>style</span><span class="token punctuation">&gt;</span></span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br></div></div></details> <h2 id="table-attributes"><a href="#table-attributes" class="header-anchor">#</a> Table Attributes</h2> <p></p> <table><thead><tr><th style="text-align:left;">参数</th> <th style="text-align:left;">说明</th> <th style="text-align:left;">类型</th> <th style="text-align:left;">可选值</th> <th style="text-align:left;">默认值</th></tr></thead> <tbody><tr><td style="text-align:left;">check-box-visible</td> <td style="text-align:left;">是否显示复选框</td> <td style="text-align:left;">Boolean</td> <td style="text-align:left;">-</td> <td style="text-align:left;">false</td></tr> <tr><td style="text-align:left;">table-heads</td> <td style="text-align:left;">表头</td> <td style="text-align:left;">Array</td> <td style="text-align:left;">-</td> <td style="text-align:left;">-</td></tr> <tr><td style="text-align:left;">form-list</td> <td style="text-align:left;">需要显示的数据</td> <td style="text-align:left;">Array</td> <td style="text-align:left;">-</td> <td style="text-align:left;">-</td></tr> <tr><td style="text-align:left;">loading</td> <td style="text-align:left;">表格加载动画</td> <td style="text-align:left;">Boolean</td> <td style="text-align:left;">-</td> <td style="text-align:left;">false</td></tr> <tr><td style="text-align:left;">formatter</td> <td style="text-align:left;">格式化表格数据</td> <td style="text-align:left;">Function(row, column, cellValue, index)</td> <td style="text-align:left;">-</td> <td style="text-align:left;">-</td></tr> <tr><td style="text-align:left;">cellAlign</td> <td style="text-align:left;">表格对齐方式</td> <td style="text-align:left;">String</td> <td style="text-align:left;">left/center/right</td> <td style="text-align:left;">center</td></tr> <tr><td style="text-align:left;">slotVisible</td> <td style="text-align:left;">是否显示操作列</td> <td style="text-align:left;">Boolean</td> <td style="text-align:left;">-</td> <td style="text-align:left;">false</td></tr> <tr><td style="text-align:left;">width</td> <td style="text-align:left;">操作列的宽度</td> <td style="text-align:left;">Number</td> <td style="text-align:left;">-</td> <td style="text-align:left;">200</td></tr></tbody></table> <h2 id="table-events"><a href="#table-events" class="header-anchor">#</a> Table Events</h2> <p></p> <table><thead><tr><th style="text-align:left;">事件名</th> <th style="text-align:left;">说明</th> <th style="text-align:left;">参数</th></tr></thead> <tbody><tr><td style="text-align:left;">handle-selection-change</td> <td style="text-align:left;">当用户手动勾选数据行的 Checkbox 时触发的事件</td> <td style="text-align:left;">row</td></tr> <tr><td style="text-align:left;">handle-sort-change</td> <td style="text-align:left;">当表格的排序条件发生变化的时候会触发该事件</td> <td style="text-align:left;">column</td></tr></tbody></table> <h2 id="table-slot"><a href="#table-slot" class="header-anchor">#</a> Table Slot</h2> <p></p> <table><thead><tr><th style="text-align:left;">name</th> <th style="text-align:left;">说明</th></tr></thead> <tbody><tr><td style="text-align:left;">-</td> <td style="text-align:left;">用于放置在操作列上的按钮等元素，需要从scope.item中获取当前行的值</td></tr></tbody></table> <h2 id="table-header-style"><a href="#table-header-style" class="header-anchor">#</a> Table Header style</h2> <p></p> <table><thead><tr><th style="text-align:left;">name</th> <th style="text-align:left;">说明</th></tr></thead> <tbody><tr><td style="text-align:left;">header-cell-style</td> <td style="text-align:left;">用于设置表头样式</td></tr></tbody></table></div></div> <!----> <div class="page-edit"><!----> <!----> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">2021/02/03, 17:01:33</span></div></div> <div class="page-nav-wapper"><div class="page-nav-centre-wrap"><a href="/doc/pages/5003ef/" class="page-nav-centre page-nav-centre-prev"><div class="tooltip">新增页面示例</div></a> <a href="/doc/pages/65ed1c/" class="page-nav-centre page-nav-centre-next"><div class="tooltip">表单组件</div></a></div> <div class="page-nav"><p class="inner"><span class="prev">
        ←
        <a href="/doc/pages/5003ef/" class="prev">新增页面示例</a></span> <span class="next"><a href="/doc/pages/65ed1c/">表单组件</a>→
      </span></p></div></div></div> <div class="article-list"><div class="article-title"><a href="/doc/archives/" class="iconfont icon-bi">最近更新</a></div> <div class="article-wrapper"><dl><dd>01</dd> <dt><a href="/doc/pages/70e14e/"><div>DataMap</div></a> <span>02-05</span></dt></dl><dl><dd>02</dd> <dt><a href="/doc/pages/ca6799/"><div>实体类</div></a> <span>02-05</span></dt></dl><dl><dd>03</dd> <dt><a href="/doc/pages/216aa8/"><div>update操作</div></a> <span>02-05</span></dt></dl> <dl><dd></dd> <dt><a href="/doc/archives/" class="more">更多文章&gt;</a></dt></dl></div></div></main></div> <div class="footer"><!----> 
  Theme by
  <a href="https://github.com/xugaoyi/vuepress-theme-vdoing" target="_blank" title="本站主题">Vdoing</a> 
    | Copyright © 2021-2021
    <span>Haocheng Liu | MIT License</a></span></div> <div class="buttons"><div title="返回顶部" class="button blur go-to-top iconfont icon-fanhuidingbu" style="display:none;"></div> <div title="去评论" class="button blur go-to-comment iconfont icon-pinglun" style="display:none;"></div> <div title="主题模式" class="button blur theme-mode-but iconfont icon-zhuti"><ul class="select-box" style="display:none;"><li class="iconfont icon-zidong">跟随系统</li><li class="iconfont icon-rijianmoshi">浅色模式</li><li class="iconfont icon-yejianmoshi">深色模式</li><li class="iconfont icon-yuedu">阅读模式</li></ul></div></div> <!----> <!----> <!----></div><div class="global-ui"></div></div>
    <script src="/doc/assets/js/app.858848c6.js" defer></script><script src="/doc/assets/js/4.5c4f8040.js" defer></script><script src="/doc/assets/js/5.dcc7613b.js" defer></script><script src="/doc/assets/js/43.89320d84.js" defer></script>
  </body>
</html>